from google.appengine.ext import webapp
from google.appengine.ext import db
from google.appengine.ext.webapp.util import run_wsgi_app
import createDB

#Class to add (post) a comment to the server 
class addComment(webapp.RequestHandler):
    def get(self):
        self.response.headers['Content-Type'] = 'text/plain'
        self.response.out.write('adding comment')
        
    def post(self):
        Place = self.request.get("place")
        Comment = self.request.get("comment")
        
        comment=createDB.Comments()
        comment.comment=Comment
        comment.placeName=Place
        comment.put()
                
application = webapp.WSGIApplication([('/addComment', addComment)], debug=True)
  
def main():
    run_wsgi_app(application)
    
if __name__ == "__main__":
    main()